home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group92c.txt
/
000053_icon-group-sender _Sun Nov 1 09:59:17 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1993-01-04
|
3KB
Received: by cheltenham.cs.arizona.edu; Mon, 2 Nov 1992 09:12:34 MST
Date: 1 Nov 92 09:59:17 GMT
From: agate!doc.ic.ac.uk!uknet!strath-cs!fulcrum!bham!news.cs.bham.ac.uk!percy!aps@ucbvax.Berkeley.EDU (Alan P Sexton)
Organization: University of Birmingham
Subject: Re: semicolons
Message-Id: <1992Nov1.095917@cs.bham.ac.uk>
References: <199210281642.AA24982@cheltenham.cs.arizona.edu>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
In article <199210281642.AA24982@cheltenham.cs.arizona.edu>, ralph@cs.arizona.edu (Ralph Griswold) writes:
|> I normally stay out of "discussions" like this, but I can't resist
|> remarking that, in practice, the semicolon insertion performed
|> by the Icon translator works well in practice, programmers like it,
|> it's been touted as one of the nice little touches that makes
|> Icon a pleasure to use, and I don't recall a single complaint
|> about the feature from a practicing Icon programmer (once they
|> understand it).
|>
|> The wisdom on idiomatic Icon programming is that semicolons should
|> never appear (syntactically) in Icon programs.
|>
|> If you want to argue syntax, what semicolon insertion does is
|> give line terminators syntactic significance. In most programs,
|> an Icon programmer thinks of a newline (or whatever your favorite
|> platform uses to terminate lines) in the same way programmers
|> in languages with similar syntax think of semicolons.
|>
|> Ralph E. Griswold ralph@cs.arizona.edu
|> Department of Computer Science uunet!arizona!ralph
|> The University of Arizona 602-621-6609 (voice)
|> Tucson, AZ 85721 602-621-9618 (fax)
Have you looked at how Turing handles this problem? It is a
pascal/euclid/modula/C-like language where (among other things) they got
rid of unnecessary syntax (nothing like ``program x'' etc.)
In particular semicolons are not necessary (they still allow them for the
benefit of those who can't seem to program without them). The interesting part
is that they are not handled by semicolon insertion: newlines are just whitespace.
Careful design of the grammar and use of a `maximal scan' principle, ensures
unambiguous parsing.
The whole thing has a formal definition and semantics (and was designed with
these objectives in mind)
c.f. ``The Turing Programming Language: Design and Definition''
R.Holt, P.Matthews, J. Rosselet, J.Cordy
Prentice Hall 1988, ISBN: 0-13-933136-0
Alan P. Sexton, Tel: 021-414 3703
University of Birmingham, School of Computer Science
Edgbaston, Birmingham B15 2TT, England
A.P.Sexton@cs.bham.ac.uk